home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Technology Seed / Jan. '98 ATS.toast / QuickTime™ 3.0b11 / QTPublicInterfaces / CIncludes / ImageCodec.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-12  |  45.6 KB  |  1,365 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ImageCodec.h
  3.  
  4.      Contains:    QuickTime interfaces
  5.  
  6.      Version:    Technology:    
  7.                  Release:    QuickTime 3.0 Beta
  8.  
  9.      Copyright:    © 1990-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __IMAGECODEC__
  19. #define __IMAGECODEC__
  20.  
  21. #ifndef __MACTYPES__
  22. #include <MacTypes.h>
  23. #endif
  24. #ifndef __QUICKDRAW__
  25. #include <Quickdraw.h>
  26. #endif
  27. #ifndef __QDOFFSCREEN__
  28. #include <QDOffscreen.h>
  29. #endif
  30. #ifndef __MACWINDOWS__
  31. #include <MacWindows.h>
  32. #endif
  33. #ifndef __IMAGECOMPRESSION__
  34. #include <ImageCompression.h>
  35. #endif
  36. #ifndef __COMPONENTS__
  37. #include <Components.h>
  38. #endif
  39. #ifndef __MOVIES__
  40. #include <Movies.h>
  41. #endif
  42. #ifndef __GXTYPES__
  43. #include <GXTypes.h>
  44. #endif
  45.  
  46.  
  47.  
  48. #if PRAGMA_ONCE
  49. #pragma once
  50. #endif
  51.  
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55.  
  56. #if PRAGMA_IMPORT
  57. #pragma import on
  58. #endif
  59.  
  60. #if PRAGMA_STRUCT_ALIGN
  61.     #pragma options align=mac68k
  62. #elif PRAGMA_STRUCT_PACKPUSH
  63.     #pragma pack(push, 2)
  64. #elif PRAGMA_STRUCT_PACK
  65.     #pragma pack(2)
  66. #endif
  67.  
  68. /*    codec capabilities flags    */
  69.  
  70. enum {
  71.     codecCanScale                = 1L << 0,
  72.     codecCanMask                = 1L << 1,
  73.     codecCanMatte                = 1L << 2,
  74.     codecCanTransform            = 1L << 3,
  75.     codecCanTransferMode        = 1L << 4,
  76.     codecCanCopyPrev            = 1L << 5,
  77.     codecCanSpool                = 1L << 6,
  78.     codecCanClipVertical        = 1L << 7,
  79.     codecCanClipRectangular        = 1L << 8,
  80.     codecCanRemapColor            = 1L << 9,
  81.     codecCanFastDither            = 1L << 10,
  82.     codecCanSrcExtract            = 1L << 11,
  83.     codecCanCopyPrevComp        = 1L << 12,
  84.     codecCanAsync                = 1L << 13,
  85.     codecCanMakeMask            = 1L << 14,
  86.     codecCanShift                = 1L << 15,
  87.     codecCanAsyncWhen            = 1L << 16,
  88.     codecCanShieldCursor        = 1L << 17,
  89.     codecCanManagePrevBuffer    = 1L << 18,
  90.     codecHasVolatileBuffer        = 1L << 19,
  91.     codecWantsRegionMask        = 1L << 20,
  92.     codecImageBufferIsOnScreen    = 1L << 21,
  93.     codecWantsDestinationPixels    = 1L << 22,
  94.     codecWantsSpecialScaling    = 1L << 23,
  95.     codecHandlesInputs            = 1L << 24,
  96.     codecCanDoIndirectSurface    = 1L << 25,
  97.     codecIsSequenceSensitive    = 1L << 26,
  98.     codecRequiresOffscreen        = 1L << 27,
  99.     codecRequiresMaskBits        = 1L << 28,
  100.     codecCanRemapResolution        = 1L << 29,
  101.     codecIsDirectToScreenOnly    = 1L << 30
  102. };
  103.  
  104.  
  105. struct CodecCapabilities {
  106.     long                             flags;
  107.     short                             wantedPixelSize;
  108.     short                             extendWidth;
  109.     short                             extendHeight;
  110.     short                             bandMin;
  111.     short                             bandInc;
  112.     short                             pad;
  113.     unsigned long                     time;
  114. };
  115. typedef struct CodecCapabilities        CodecCapabilities;
  116. /*    codec condition flags    */
  117.  
  118. enum {
  119.     codecConditionFirstBand        = 1L << 0,
  120.     codecConditionLastBand        = 1L << 1,
  121.     codecConditionFirstFrame    = 1L << 2,
  122.     codecConditionNewDepth        = 1L << 3,
  123.     codecConditionNewTransform    = 1L << 4,
  124.     codecConditionNewSrcRect    = 1L << 5,
  125.     codecConditionNewMask        = 1L << 6,
  126.     codecConditionNewMatte        = 1L << 7,
  127.     codecConditionNewTransferMode = 1L << 8,
  128.     codecConditionNewClut        = 1L << 9,
  129.     codecConditionNewAccuracy    = 1L << 10,
  130.     codecConditionNewDestination = 1L << 11,
  131.     codecConditionFirstScreen    = 1L << 12,
  132.     codecConditionDoCursor        = 1L << 13,
  133.     codecConditionCatchUpDiff    = 1L << 14,
  134.     codecConditionMaskMayBeChanged = 1L << 15,
  135.     codecConditionToBuffer        = 1L << 16,
  136.     codecConditionCodecChangedMask = 1L << 31
  137. };
  138.  
  139.  
  140.  
  141. enum {
  142.     codecInfoResourceType        = FOUR_CHAR_CODE('cdci'),        /* codec info resource type */
  143.     codecInterfaceVersion        = 2                                /* high word returned in component GetVersion */
  144. };
  145.  
  146.  
  147. struct CDSequenceDataSourceQueueEntry {
  148.     void *                            nextBusy;
  149.  
  150.     long                             descSeed;
  151.     Handle                             dataDesc;
  152.     void *                            data;
  153.     long                             dataSize;
  154.  
  155.     long                             useCount;
  156.  
  157.     TimeValue                         frameTime;
  158.     TimeValue                         frameDuration;
  159.     TimeValue                         timeScale;
  160. };
  161. typedef struct CDSequenceDataSourceQueueEntry CDSequenceDataSourceQueueEntry;
  162. typedef CDSequenceDataSourceQueueEntry * CDSequenceDataSourceQueueEntryPtr;
  163.  
  164. struct CDSequenceDataSource {
  165.     long                             recordSize;
  166.  
  167.     void *                            next;
  168.  
  169.     ImageSequence                     seqID;
  170.     ImageSequenceDataSource         sourceID;
  171.     OSType                             sourceType;
  172.     long                             sourceInputNumber;
  173.  
  174.     void *                            dataPtr;
  175.     Handle                             dataDescription;
  176.     long                             changeSeed;
  177.     ICMConvertDataFormatUPP         transferProc;
  178.     void *                            transferRefcon;
  179.     long                             dataSize;
  180.  
  181.                                                                 /* fields available in QT 3 and later */
  182.  
  183.     QHdrPtr                         dataQueue;                    /* queue of CDSequenceDataSourceQueueEntry structures*/
  184.  
  185.     void *                            originalDataPtr;
  186.     long                             originalDataSize;
  187.     Handle                             originalDataDescription;
  188.     long                             originalDataDescriptionSeed;
  189. };
  190. typedef struct CDSequenceDataSource        CDSequenceDataSource;
  191. typedef CDSequenceDataSource *            CDSequenceDataSourcePtr;
  192.  
  193. struct ICMFrameTimeInfo {
  194.     wide                             startTime;
  195.     long                             scale;
  196.     long                             duration;
  197. };
  198. typedef struct ICMFrameTimeInfo            ICMFrameTimeInfo;
  199. typedef ICMFrameTimeInfo *                ICMFrameTimeInfoPtr;
  200.  
  201. struct CodecCompressParams {
  202.     ImageSequence                     sequenceID;                    /* precompress,bandcompress */
  203.     ImageDescriptionHandle             imageDescription;            /* precompress,bandcompress */
  204.     Ptr                             data;
  205.     long                             bufferSize;
  206.     long                             frameNumber;
  207.     long                             startLine;
  208.     long                             stopLine;
  209.     long                             conditionFlags;
  210.     CodecFlags                         callerFlags;
  211.     CodecCapabilities *                capabilities;                /* precompress,bandcompress */
  212.     ICMProgressProcRecord             progressProcRecord;
  213.     ICMCompletionProcRecord         completionProcRecord;
  214.     ICMFlushProcRecord                 flushProcRecord;
  215.  
  216.     PixMap                             srcPixMap;                    /* precompress,bandcompress */
  217.     PixMap                             prevPixMap;
  218.     CodecQ                             spatialQuality;
  219.     CodecQ                             temporalQuality;
  220.     Fixed                             similarity;
  221.     DataRateParamsPtr                 dataRateParams;
  222.     long                             reserved;
  223.  
  224.                                                                 /* The following fields only exist for QuickTime 2.1 and greater */
  225.     UInt16                             majorSourceChangeSeed;
  226.     UInt16                             minorSourceChangeSeed;
  227.     CDSequenceDataSourcePtr         sourceData;
  228.  
  229.                                                                 /* The following fields only exit for QuickTime 2.5 and greater */
  230.     long                             preferredPacketSizeInBytes;
  231.  
  232.                                                                 /* The following fields only exit for QuickTime 3.0 and greater */
  233.     long                             requestedBufferWidth;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  234.     long                             requestedBufferHeight;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  235. };
  236. typedef struct CodecCompressParams        CodecCompressParams;
  237.  
  238. struct CodecDecompressParams {
  239.     ImageSequence                     sequenceID;                    /* predecompress,banddecompress */
  240.     ImageDescriptionHandle             imageDescription;            /* predecompress,banddecompress */
  241.     Ptr                             data;
  242.     long                             bufferSize;
  243.     long                             frameNumber;
  244.     long                             startLine;
  245.     long                             stopLine;
  246.     long                             conditionFlags;
  247.     CodecFlags                         callerFlags;
  248.     CodecCapabilities *                capabilities;                /* predecompress,banddecompress */
  249.     ICMProgressProcRecord             progressProcRecord;
  250.     ICMCompletionProcRecord         completionProcRecord;
  251.     ICMDataProcRecord                 dataProcRecord;
  252.  
  253.     CGrafPtr                         port;                        /* predecompress,banddecompress */
  254.     PixMap                             dstPixMap;                    /* predecompress,banddecompress */
  255.     BitMapPtr                         maskBits;
  256.     PixMapPtr                         mattePixMap;
  257.     Rect                             srcRect;                    /* predecompress,banddecompress */
  258.     MatrixRecord *                    matrix;                        /* predecompress,banddecompress */
  259.     CodecQ                             accuracy;                    /* predecompress,banddecompress */
  260.     short                             transferMode;                /* predecompress,banddecompress */
  261.     ICMFrameTimePtr                 frameTime;                    /* banddecompress */
  262.     long                             reserved[1];
  263.                                                                 /* The following fields only exist for QuickTime 2.0 and greater */
  264.     SInt8                             matrixFlags;                /* high bit set if 2x resize */
  265.     SInt8                             matrixType;
  266.     Rect                             dstRect;                    /* only valid for simple transforms */
  267.                                                                 /* The following fields only exist for QuickTime 2.1 and greater */
  268.     UInt16                             majorSourceChangeSeed;
  269.     UInt16                             minorSourceChangeSeed;
  270.     CDSequenceDataSourcePtr         sourceData;
  271.  
  272.     RgnHandle                         maskRegion;
  273.  
  274.                                                                 /* The following fields only exist for QuickTime 2.5 and greater */
  275.  
  276.     OSType **                        wantedDestinationPixelTypes; /* Handle to 0-terminated list of OSTypes */
  277.  
  278.     long                             screenFloodMethod;
  279.     long                             screenFloodValue;
  280.     short                             preferredOffscreenPixelSize;
  281.  
  282.                                                                 /* The following fields only exist for QuickTime 3.0 and greater */
  283.     ICMFrameTimeInfoPtr             syncFrameTime;                /* banddecompress */
  284.     Boolean                         needUpdateOnTimeChange;        /* banddecompress */
  285.     Boolean                         enableBlackLining;
  286.     Boolean                         needUpdateOnSourceChange;    /* band decompress */
  287.     Boolean                         pad;
  288.  
  289.     long                             unused;
  290.  
  291.     CGrafPtr                         finalDestinationPort;
  292.  
  293.     long                             requestedBufferWidth;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  294.     long                             requestedBufferHeight;        /* must set codecWantsSpecialScaling to indicate this field is valid*/
  295. };
  296. typedef struct CodecDecompressParams    CodecDecompressParams;
  297.  
  298. enum {
  299.     matrixFlagScale2x            = 1L << 7,
  300.     matrixFlagScale1x            = 1L << 6,
  301.     matrixFlagScaleHalf            = 1L << 5
  302. };
  303.  
  304.  
  305. enum {
  306.     kScreenFloodMethodNone        = 0,
  307.     kScreenFloodMethodKeyColor    = 1,
  308.     kScreenFloodMethodAlpha        = 2
  309. };
  310.  
  311.  
  312. enum {
  313.     kFlushLastQueuedFrame        = 0,
  314.     kFlushFirstQueuedFrame        = 1
  315. };
  316.  
  317.  
  318. enum {
  319.     kNewImageGWorldErase        = 1L << 0
  320. };
  321.  
  322.  
  323. struct ImageSubCodecDecompressCapabilities {
  324.     long                             recordSize;                    /* sizeof(ImageSubCodecDecompressCapabilities)*/
  325.     long                             decompressRecordSize;        /* size of your codec's decompress record*/
  326.     Boolean                         canAsync;                    /* default true*/
  327.     UInt8                             pad[3];
  328. };
  329. typedef struct ImageSubCodecDecompressCapabilities ImageSubCodecDecompressCapabilities;
  330.  
  331. enum {
  332.     kCodecFrameTypeUnknown        = 0,
  333.     kCodecFrameTypeKey            = 1,
  334.     kCodecFrameTypeDifference    = 2,
  335.     kCodecFrameTypeDroppableDifference = 3
  336. };
  337.  
  338.  
  339. struct ImageSubCodecDecompressRecord {
  340.     Ptr                             baseAddr;
  341.     long                             rowBytes;
  342.     Ptr                             codecData;
  343.     ICMProgressProcRecord             progressProcRecord;
  344.     ICMDataProcRecord                 dataProcRecord;
  345.     void *                            userDecompressRecord;        /* pointer to codec-specific per-band data*/
  346.     UInt8                             frameType;
  347.     UInt8                             pad[3];
  348. };
  349. typedef struct ImageSubCodecDecompressRecord ImageSubCodecDecompressRecord;
  350. /* name of parameters or effect -- placed in root container, optional */
  351.  
  352. enum {
  353.     kParameterTitleName            = FOUR_CHAR_CODE('name'),
  354.     kParameterTitleID            = 1
  355. };
  356.  
  357. /* name of parameters or effect -- placed in root container, required */
  358.  
  359. enum {
  360.     kParameterWhatName            = FOUR_CHAR_CODE('what'),
  361.     kParameterWhatID            = 1
  362. };
  363.  
  364. /* maximum number of sources -- placed in root container, required */
  365.  
  366. enum {
  367.     kParameterSourceCountName    = FOUR_CHAR_CODE('srcs'),
  368.     kParameterSourceCountID        = 1
  369. };
  370.  
  371.  
  372.  
  373. enum {
  374.     kParameterDependencyName    = FOUR_CHAR_CODE('deep'),
  375.     kParameterDependencyID        = 1
  376. };
  377.  
  378.  
  379. enum {
  380.     kParameterListDependsUponColorProfiles = FOUR_CHAR_CODE('prof'),
  381.     kParameterListDependsUponFonts = FOUR_CHAR_CODE('font')
  382. };
  383.  
  384.  
  385. struct ParameterDependancyRecord {
  386.     long                             dependCount;
  387.     OSType                             depends[1];
  388. };
  389. typedef struct ParameterDependancyRecord ParameterDependancyRecord;
  390. /*
  391.    enumeration list in container -- placed in root container, optional unless used by a
  392.    parameter in the list
  393. */
  394.  
  395. enum {
  396.     kParameterEnumList            = FOUR_CHAR_CODE('enum')
  397. };
  398.  
  399.  
  400. struct EnumValuePair {
  401.     long                             value;
  402.     Str255                             name;
  403. };
  404. typedef struct EnumValuePair            EnumValuePair;
  405.  
  406. struct EnumListRecord {
  407.     long                             enumCount;                    /* number of enumeration items to follow*/
  408.     EnumValuePair                     values[1];                    /* values and names for them, packed */
  409. };
  410. typedef struct EnumListRecord            EnumListRecord;
  411. /* atom type of parameter*/
  412.  
  413. enum {
  414.     kParameterAtomTypeAndID        = FOUR_CHAR_CODE('type')
  415. };
  416.  
  417.  
  418. enum {
  419.     kNoAtom                        = FOUR_CHAR_CODE('none'),        /* atom type for no data got/set*/
  420.     kAtomNoFlags                = 0x00000000,
  421.     kAtomNotInterpolated        = 0x00000001,                    /* atom can never be interpolated*/
  422.     kAtomInterpolateIsOptional    = 0x00000002                    /* atom can be interpolated, but it is an advanced user operation*/
  423. };
  424.  
  425.  
  426. struct ParameterAtomTypeAndID {
  427.     QTAtomType                         atomType;                    /* type of atom this data comes from/goes into*/
  428.     QTAtomID                         atomID;                        /* ID of atom this data comes from/goes into*/
  429.     long                             atomFlags;                    /* options for this atom*/
  430.     Str255                             atomName;                    /* name of this value type*/
  431. };
  432. typedef struct ParameterAtomTypeAndID    ParameterAtomTypeAndID;
  433. /* data type of a parameter*/
  434.  
  435. enum {
  436.     kParameterDataType            = FOUR_CHAR_CODE('data')
  437. };
  438.  
  439.  
  440. enum {
  441.     kParameterTypeDataLong        = kTweenTypeLong,                /* integer value*/
  442.     kParameterTypeDataFixed        = kTweenTypeFixed,                /* fixed point value*/
  443.     kParameterTypeDataRGBValue    = kTweenTypeRGBColor,            /* RGBColor data*/
  444.     kParameterTypeDataDouble    = kTweenTypeQTFloatDouble,        /* IEEE 64 bit floating point value*/
  445.     kParameterTypeDataText        = FOUR_CHAR_CODE('text'),        /* editable text item*/
  446.     kParameterTypeDataEnum        = FOUR_CHAR_CODE('enum'),        /* enumerated lookup value*/
  447.     kParameterTypeDataBitField    = FOUR_CHAR_CODE('bool'),        /* bit field value (something that holds boolean(s))*/
  448.     kParameterTypeDataImage        = FOUR_CHAR_CODE('imag')        /* reference to an image via Picture data*/
  449. };
  450.  
  451.  
  452. struct ParameterDataType {
  453.     OSType                             dataType;                    /* type of data this item is stored as*/
  454. };
  455. typedef struct ParameterDataType        ParameterDataType;
  456. /*
  457.    alternate (optional) data type -- main data type always required.  
  458.    Must be modified or deleted when modifying main data type.
  459.    Main data type must be modified when alternate is modified.
  460. */
  461.  
  462. enum {
  463.     kParameterAlternateDataType    = FOUR_CHAR_CODE('alt1'),
  464.     kParameterTypeDataColorValue = FOUR_CHAR_CODE('cmlr'),        /* CMColor data (supported on machines with ColorSync)*/
  465.     kParameterTypeDataCubic        = FOUR_CHAR_CODE('cubi'),        /* cubic bezier(s) (no built-in support)*/
  466.     kParameterTypeDataNURB        = FOUR_CHAR_CODE('nurb')        /* nurb(s) (no built-in support)*/
  467. };
  468.  
  469.  
  470. struct ParameterAlternateDataEntry {
  471.     OSType                             dataType;                    /* type of data this item is stored as*/
  472.     QTAtomType                         alternateAtom;                /* where to store*/
  473. };
  474. typedef struct ParameterAlternateDataEntry ParameterAlternateDataEntry;
  475.  
  476. struct ParameterAlternateDataType {
  477.     long                             numEntries;
  478.     ParameterAlternateDataEntry     entries[1];
  479. };
  480. typedef struct ParameterAlternateDataType ParameterAlternateDataType;
  481. /* legal values for the parameter*/
  482.  
  483. enum {
  484.     kParameterDataRange            = FOUR_CHAR_CODE('rang')
  485. };
  486.  
  487.  
  488. enum {
  489.     kNoMinimumLongFixed            = 0x7FFFFFFF,                    /* ignore minimum/maxiumum values*/
  490.     kNoMaximumLongFixed            = (long)0x80000000,
  491.     kNoScaleLongFixed            = 0,                            /* don't perform any scaling of value*/
  492.     kNoPrecision                = (-1)                            /* allow as many digits as format*/
  493. };
  494.  
  495. /* 'text'*/
  496.  
  497. struct StringRangeRecord {
  498.     long                             maxChars;                    /* maximum length of string*/
  499.     long                             maxLines;                    /* number of editing lines to use (1 typical, 0 to default)*/
  500. };
  501. typedef struct StringRangeRecord        StringRangeRecord;
  502. /* 'long'*/
  503.  
  504. struct LongRangeRecord {
  505.     long                             minValue;                    /* no less than this*/
  506.     long                             maxValue;                    /* no more than this*/
  507.     long                             scaleValue;                    /* muliply content by this going in, divide going out*/
  508.     long                             precisionDigits;            /* # digits of precision when editing via typing*/
  509. };
  510. typedef struct LongRangeRecord            LongRangeRecord;
  511. /* 'enum'*/
  512.  
  513. struct EnumRangeRecord {
  514.     long                             enumID;                        /* 'enum' list in root container to search within*/
  515. };
  516. typedef struct EnumRangeRecord            EnumRangeRecord;
  517. /* 'fixd'*/
  518.  
  519. struct FixedRangeRecord {
  520.     Fixed                             minValue;                    /* no less than this*/
  521.     Fixed                             maxValue;                    /* no more than this*/
  522.     Fixed                             scaleValue;                    /* muliply content by this going in, divide going out*/
  523.     long                             precisionDigits;            /* # digits of precision when editing via typing*/
  524. };
  525. typedef struct FixedRangeRecord            FixedRangeRecord;
  526. /* 'doub'*/
  527.  
  528.     #define kNoMinimumDouble        (NAN)                    // ignore minimum/maxiumum values
  529.     #define kNoMaximumDouble        (NAN)
  530.     #define kNoScaleDouble            (0)                        // don't perform any scaling of value
  531.     struct DoubleRangeRecord
  532.         {
  533.         QTFloatDouble        minValue;            // no less than this
  534.         QTFloatDouble        maxValue;            // no more than this
  535.         QTFloatDouble        scaleValue;            // muliply content by this going in, divide going out
  536.         long                precisionDigits;    // # digits of precision when editing via typing
  537.         };
  538.     typedef struct DoubleRangeRecord DoubleRangeRecord;
  539.     
  540. /* 'bool'    */
  541.  
  542. struct BooleanRangeRecord {
  543.     long                             maskValue;                    /* value to mask on/off to set/clear the boolean*/
  544. };
  545. typedef struct BooleanRangeRecord        BooleanRangeRecord;
  546. /* 'rgb '*/
  547.  
  548. struct RGBRangeRecord {
  549.     RGBColor                         minColor;
  550.     RGBColor                         maxColor;
  551. };
  552. typedef struct RGBRangeRecord            RGBRangeRecord;
  553. /* 'imag'*/
  554.  
  555. enum {
  556.     kParameterImageNoFlags        = 0
  557. };
  558.  
  559.  
  560. struct ImageRangeRecord {
  561.     long                             imageFlags;
  562. };
  563. typedef struct ImageRangeRecord            ImageRangeRecord;
  564. /* union of all of the above*/
  565.  
  566.     struct ParameterRangeRecord
  567.         {
  568.         union 
  569.             {
  570.             LongRangeRecord        longRange;
  571.             EnumRangeRecord        enumRange;
  572.             FixedRangeRecord    fixedRange;
  573.             DoubleRangeRecord    doubleRange;
  574.             StringRangeRecord    stringRange;
  575.             BooleanRangeRecord    booleanRange;
  576.             RGBRangeRecord        rgbRange;
  577.             ImageRangeRecord    imageRange;
  578.             } u;
  579.         };
  580.     typedef struct ParameterRangeRecord ParameterRangeRecord;
  581.     
  582. /* UI behavior of a parameter*/
  583.  
  584. enum {
  585.     kParameterDataBehavior        = FOUR_CHAR_CODE('ditl')
  586. };
  587.  
  588.  
  589. enum {
  590.                                                                 /* items edited via typing*/
  591.     kParameterItemEditText        = FOUR_CHAR_CODE('edit'),        /* edit text box*/
  592.     kParameterItemEditLong        = FOUR_CHAR_CODE('long'),        /* long number editing box*/
  593.     kParameterItemEditFixed        = FOUR_CHAR_CODE('fixd'),        /* fixed point number editing box*/
  594.     kParameterItemEditDouble    = FOUR_CHAR_CODE('doub'),        /* double number editing box*/
  595.                                                                 /* items edited via control(s)*/
  596.     kParameterItemPopUp            = FOUR_CHAR_CODE('popu'),        /* pop up value for enum types*/
  597.     kParameterItemRadioCluster    = FOUR_CHAR_CODE('radi'),        /* radio cluster for enum types*/
  598.     kParameterItemCheckBox        = FOUR_CHAR_CODE('chex'),        /* check box for booleans*/
  599.     kParameterItemControl        = FOUR_CHAR_CODE('cntl'),        /* item controlled via a standard control of some type*/
  600.                                                                 /* special user items*/
  601.     kParameterItemLine            = FOUR_CHAR_CODE('line'),        /* line*/
  602.     kParameterItemColorPicker    = FOUR_CHAR_CODE('pick'),        /* color swatch & picker*/
  603.     kParameterItemGroupDivider    = FOUR_CHAR_CODE('divi'),        /* start of a new group of items*/
  604.     kParameterItemStaticText    = FOUR_CHAR_CODE('stat'),        /* display "parameter name" as static text*/
  605.     kParameterItemDragImage        = FOUR_CHAR_CODE('imag'),        /* allow image display, along with drag and drop*/
  606.                                                                 /* flags valid for lines and groups*/
  607.     kGraphicsNoFlags            = 0x00000000,                    /* no options for graphics*/
  608.     kGraphicsFlagsGray            = 0x00000001,                    /* draw lines with gray*/
  609.                                                                 /* flags valid for groups*/
  610.     kGroupNoFlags                = 0x00000000,                    /* no options for group -- may be combined with graphics options                        */
  611.     kGroupAlignText                = 0x00010000,                    /* edit text items in group have the same size*/
  612.     kGroupSurroundBox            = 0x00020000,                    /* group should be surrounded with a box*/
  613.     kGroupMatrix                = 0x00040000,                    /* side-by-side arrangement of group is okay*/
  614.     kGroupNoName                = 0x00080000,                    /* name of group should not be displayed above box*/
  615.                                                                 /* flags valid for popup/radiocluster/checkbox/control*/
  616.     kDisableControl                = 0x00000001,
  617.     kDisableWhenNotEqual        = (0x00000000 + kDisableControl),
  618.     kDisableWhenEqual            = (0x00000010 + kDisableControl),
  619.     kDisableWhenLessThan        = (0x00000020 + kDisableControl),
  620.     kDisableWhenGreaterThan        = (0x00000030 + kDisableControl), /* flags valid for popups*/
  621.     kPopupStoreAsString            = 0x00010000
  622. };
  623.  
  624.  
  625. struct ControlBehaviors {
  626.     QTAtomID                         groupID;                    /* group under control of this item*/
  627.     long                             controlValue;                /* control value for comparison purposes*/
  628. };
  629. typedef struct ControlBehaviors            ControlBehaviors;
  630.  
  631. struct ParameterDataBehavior {
  632.     OSType                             behaviorType;
  633.     long                             behaviorFlags;
  634.     union {
  635.         ControlBehaviors                 controls;
  636.     }                                 u;
  637. };
  638. typedef struct ParameterDataBehavior    ParameterDataBehavior;
  639. /* higher level purpose of a parameter or set of parameters*/
  640.  
  641. enum {
  642.     kParameterDataUsage            = FOUR_CHAR_CODE('use ')
  643. };
  644.  
  645.  
  646. enum {
  647.     kParameterUsagePixels        = FOUR_CHAR_CODE('pixl'),
  648.     kParameterUsageRectangle    = FOUR_CHAR_CODE('rect'),
  649.     kParameterUsagePoint        = FOUR_CHAR_CODE('xy  '),
  650.     kParameterUsage3DPoint        = FOUR_CHAR_CODE('xyz '),
  651.     kParameterUsageDegrees        = FOUR_CHAR_CODE('degr'),
  652.     kParameterUsageRadians        = FOUR_CHAR_CODE('rads'),
  653.     kParameterUsagePercent        = FOUR_CHAR_CODE('pcnt'),
  654.     kParameterUsageSeconds        = FOUR_CHAR_CODE('secs'),
  655.     kParameterUsageMilliseconds    = FOUR_CHAR_CODE('msec'),
  656.     kParameterUsageMicroseconds    = FOUR_CHAR_CODE('µsec'),
  657.     kParameterUsage3by3Matrix    = FOUR_CHAR_CODE('3by3')
  658. };
  659.  
  660.  
  661. struct ParameterDataUsage {
  662.     OSType                             usageType;                    /* higher level purpose of the data or group*/
  663. };
  664. typedef struct ParameterDataUsage        ParameterDataUsage;
  665. /* default value(s) for a parameter*/
  666.  
  667. enum {
  668.     kParameterDataDefaultItem    = FOUR_CHAR_CODE('dflt')
  669. };
  670.  
  671. /* atoms that help to fill in data within the info window */
  672.  
  673. enum {
  674.     kParameterInfoLongName        = FOUR_CHAR_CODE('©nam'),
  675.     kParameterInfoCopyright        = FOUR_CHAR_CODE('©cpy'),
  676.     kParameterInfoDescription    = FOUR_CHAR_CODE('©inf'),
  677.     kParameterInfoWindowTitle    = FOUR_CHAR_CODE('©wnt'),
  678.     kParameterInfoPicture        = FOUR_CHAR_CODE('©pix'),
  679.     kParameterInfoIDs            = 1
  680. };
  681.  
  682. /* flags for ImageCodecValidateParameters */
  683.  
  684. enum {
  685.     kParameterValidationNoFlags    = 0x00000000,
  686.     kParameterValidationFinalValidation = 0x00000001
  687. };
  688.  
  689.  
  690. typedef long                             QTParameterValidationOptions;
  691. typedef CALLBACK_API( ComponentResult , ImageCodecMPDrawBandProcPtr )(void *refcon, ImageSubCodecDecompressRecord *drp);
  692. typedef STACK_UPP_TYPE(ImageCodecMPDrawBandProcPtr)             ImageCodecMPDrawBandUPP;
  693. enum { uppImageCodecMPDrawBandProcInfo = 0x000003F0 };             /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  694. #define NewImageCodecMPDrawBandProc(userRoutine)                 (ImageCodecMPDrawBandUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppImageCodecMPDrawBandProcInfo, GetCurrentArchitecture())
  695. #define CallImageCodecMPDrawBandProc(userRoutine, refcon, drp)     CALL_TWO_PARAMETER_UPP((userRoutine), uppImageCodecMPDrawBandProcInfo, (refcon), (drp))
  696. /*    codec selectors 0-127 are reserved by Apple */
  697. /*    codec selectors 128-191 are subtype specific */
  698. /*    codec selectors 192-255 are vendor specific */
  699. /*    codec selectors 256-32767 are available for general use */
  700. /*    negative selectors are reserved by the Component Manager */
  701. EXTERN_API( ComponentResult )
  702. ImageCodecGetCodecInfo            (ComponentInstance         ci,
  703.                                  CodecInfo *            info)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0000, 0x7000, 0xA82A);
  704.  
  705. EXTERN_API( ComponentResult )
  706. ImageCodecGetCompressionTime    (ComponentInstance         ci,
  707.                                  PixMapHandle             src,
  708.                                  const Rect *            srcRect,
  709.                                  short                     depth,
  710.                                  CodecQ *                spatialQuality,
  711.                                  CodecQ *                temporalQuality,
  712.                                  unsigned long *        time)                                FIVEWORDINLINE(0x2F3C, 0x0016, 0x0001, 0x7000, 0xA82A);
  713.  
  714. EXTERN_API( ComponentResult )
  715. ImageCodecGetMaxCompressionSize    (ComponentInstance         ci,
  716.                                  PixMapHandle             src,
  717.                                  const Rect *            srcRect,
  718.                                  short                     depth,
  719.                                  CodecQ                 quality,
  720.                                  long *                    size)                                FIVEWORDINLINE(0x2F3C, 0x0012, 0x0002, 0x7000, 0xA82A);
  721.  
  722. EXTERN_API( ComponentResult )
  723. ImageCodecPreCompress            (ComponentInstance         ci,
  724.                                  CodecCompressParams *    params)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0003, 0x7000, 0xA82A);
  725.  
  726. EXTERN_API( ComponentResult )
  727. ImageCodecBandCompress            (ComponentInstance         ci,
  728.                                  CodecCompressParams *    params)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  729.  
  730. EXTERN_API( ComponentResult )
  731. ImageCodecPreDecompress            (ComponentInstance         ci,
  732.                                  CodecDecompressParams * params)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  733.  
  734. EXTERN_API( ComponentResult )
  735. ImageCodecBandDecompress        (ComponentInstance         ci,
  736.                                  CodecDecompressParams * params)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  737.  
  738. EXTERN_API( ComponentResult )
  739. ImageCodecBusy                    (ComponentInstance         ci,
  740.                                  ImageSequence             seq)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  741.  
  742. EXTERN_API( ComponentResult )
  743. ImageCodecGetCompressedImageSize (ComponentInstance     ci,
  744.                                  ImageDescriptionHandle  desc,
  745.                                  Ptr                     data,
  746.                                  long                     bufferSize,
  747.                                  ICMDataProcRecordPtr     dataProc,
  748.                                  long *                    dataSize)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0008, 0x7000, 0xA82A);
  749.  
  750. EXTERN_API( ComponentResult )
  751. ImageCodecGetSimilarity            (ComponentInstance         ci,
  752.                                  PixMapHandle             src,
  753.                                  const Rect *            srcRect,
  754.                                  ImageDescriptionHandle  desc,
  755.                                  Ptr                     data,
  756.                                  Fixed *                similarity)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0009, 0x7000, 0xA82A);
  757.  
  758. EXTERN_API( ComponentResult )
  759. ImageCodecTrimImage                (ComponentInstance         ci,
  760.                                  ImageDescriptionHandle  Desc,
  761.                                  Ptr                     inData,
  762.                                  long                     inBufferSize,
  763.                                  ICMDataProcRecordPtr     dataProc,
  764.                                  Ptr                     outData,
  765.                                  long                     outBufferSize,
  766.                                  ICMFlushProcRecordPtr     flushProc,
  767.                                  Rect *                    trimRect,
  768.                                  ICMProgressProcRecordPtr  progressProc)                    FIVEWORDINLINE(0x2F3C, 0x0024, 0x000A, 0x7000, 0xA82A);
  769.  
  770. EXTERN_API( ComponentResult )
  771. ImageCodecRequestSettings        (ComponentInstance         ci,
  772.                                  Handle                 settings,
  773.                                  Rect *                    rp,
  774.                                  ModalFilterUPP         filterProc)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x000B, 0x7000, 0xA82A);
  775.  
  776. EXTERN_API( ComponentResult )
  777. ImageCodecGetSettings            (ComponentInstance         ci,
  778.                                  Handle                 settings)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  779.  
  780. EXTERN_API( ComponentResult )
  781. ImageCodecSetSettings            (ComponentInstance         ci,
  782.                                  Handle                 settings)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  783.  
  784. EXTERN_API( ComponentResult )
  785. ImageCodecFlush                    (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x000E, 0x7000, 0xA82A);
  786.  
  787. EXTERN_API( ComponentResult )
  788. ImageCodecSetTimeCode            (ComponentInstance         ci,
  789.                                  void *                    timeCodeFormat,
  790.                                  void *                    timeCodeTime)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x000F, 0x7000, 0xA82A);
  791.  
  792. EXTERN_API( ComponentResult )
  793. ImageCodecIsImageDescriptionEquivalent (ComponentInstance  ci,
  794.                                  ImageDescriptionHandle  newDesc,
  795.                                  Boolean *                equivalent)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  796.  
  797. EXTERN_API( ComponentResult )
  798. ImageCodecNewMemory                (ComponentInstance         ci,
  799.                                  Ptr *                    data,
  800.                                  Size                     dataSize,
  801.                                  long                     dataUse,
  802.                                  ICMMemoryDisposedUPP     memoryGoneProc,
  803.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0014, 0x0011, 0x7000, 0xA82A);
  804.  
  805. EXTERN_API( ComponentResult )
  806. ImageCodecDisposeMemory            (ComponentInstance         ci,
  807.                                  Ptr                     data)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  808.  
  809. EXTERN_API( ComponentResult )
  810. ImageCodecHitTestData            (ComponentInstance         ci,
  811.                                  ImageDescriptionHandle  desc,
  812.                                  void *                    data,
  813.                                  Size                     dataSize,
  814.                                  Point                     where,
  815.                                  Boolean *                hit)                                FIVEWORDINLINE(0x2F3C, 0x0014, 0x0013, 0x7000, 0xA82A);
  816.  
  817. EXTERN_API( ComponentResult )
  818. ImageCodecNewImageBufferMemory    (ComponentInstance         ci,
  819.                                  CodecDecompressParams * params,
  820.                                  long                     flags,
  821.                                  ICMMemoryDisposedUPP     memoryGoneProc,
  822.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x0014, 0x7000, 0xA82A);
  823.  
  824. EXTERN_API( ComponentResult )
  825. ImageCodecExtractAndCombineFields (ComponentInstance     ci,
  826.                                  long                     fieldFlags,
  827.                                  void *                    data1,
  828.                                  long                     dataSize1,
  829.                                  ImageDescriptionHandle  desc1,
  830.                                  void *                    data2,
  831.                                  long                     dataSize2,
  832.                                  ImageDescriptionHandle  desc2,
  833.                                  void *                    outputData,
  834.                                  long *                    outDataSize,
  835.                                  ImageDescriptionHandle  descOut)                            FIVEWORDINLINE(0x2F3C, 0x0028, 0x0015, 0x7000, 0xA82A);
  836.  
  837. EXTERN_API( ComponentResult )
  838. ImageCodecGetMaxCompressionSizeWithSources (ComponentInstance  ci,
  839.                                  PixMapHandle             src,
  840.                                  const Rect *            srcRect,
  841.                                  short                     depth,
  842.                                  CodecQ                 quality,
  843.                                  CDSequenceDataSourcePtr  sourceData,
  844.                                  long *                    size)                                FIVEWORDINLINE(0x2F3C, 0x0016, 0x0016, 0x7000, 0xA82A);
  845.  
  846. EXTERN_API( ComponentResult )
  847. ImageCodecSetTimeBase            (ComponentInstance         ci,
  848.                                  void *                    base)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0017, 0x7000, 0xA82A);
  849.  
  850. EXTERN_API( ComponentResult )
  851. ImageCodecSourceChanged            (ComponentInstance         ci,
  852.                                  UInt32                 majorSourceChangeSeed,
  853.                                  UInt32                 minorSourceChangeSeed,
  854.                                  CDSequenceDataSourcePtr  sourceData,
  855.                                  long *                    flagsOut)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x0018, 0x7000, 0xA82A);
  856.  
  857. EXTERN_API( ComponentResult )
  858. ImageCodecFlushFrame            (ComponentInstance         ci,
  859.                                  UInt32                 flags)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0019, 0x7000, 0xA82A);
  860.  
  861. EXTERN_API( ComponentResult )
  862. ImageCodecGetSettingsAsText        (ComponentInstance         ci,
  863.                                  Handle *                text)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  864.  
  865. EXTERN_API( ComponentResult )
  866. ImageCodecGetParameterListHandle (ComponentInstance     ci,
  867.                                  Handle *                parameterDescriptionHandle)            FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  868.  
  869. EXTERN_API( ComponentResult )
  870. ImageCodecGetParameterList        (ComponentInstance         ci,
  871.                                  QTAtomContainer *        parameterDescription)                FIVEWORDINLINE(0x2F3C, 0x0004, 0x001C, 0x7000, 0xA82A);
  872.  
  873. EXTERN_API( ComponentResult )
  874. ImageCodecCreateStandardParameterDialog (ComponentInstance  ci,
  875.                                  QTAtomContainer         parameterDescription,
  876.                                  QTAtomContainer         parameters,
  877.                                  QTParameterDialogOptions  dialogOptions,
  878.                                  DialogPtr                 existingDialog,
  879.                                  short                     existingUserItem,
  880.                                  QTParameterDialog *    createdDialog)                        FIVEWORDINLINE(0x2F3C, 0x0016, 0x001D, 0x7000, 0xA82A);
  881.  
  882. EXTERN_API( ComponentResult )
  883. ImageCodecIsStandardParameterDialogEvent (ComponentInstance  ci,
  884.                                  EventRecord *            pEvent,
  885.                                  QTParameterDialog         createdDialog)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x001E, 0x7000, 0xA82A);
  886.  
  887. EXTERN_API( ComponentResult )
  888. ImageCodecDismissStandardParameterDialog (ComponentInstance  ci,
  889.                                  QTParameterDialog         createdDialog)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x001F, 0x7000, 0xA82A);
  890.  
  891. EXTERN_API( ComponentResult )
  892. ImageCodecStandardParameterDialogDoAction (ComponentInstance  ci,
  893.                                  QTParameterDialog         createdDialog,
  894.                                  long                     action,
  895.                                  void *                    params)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0020, 0x7000, 0xA82A);
  896.  
  897. EXTERN_API( ComponentResult )
  898. ImageCodecNewImageGWorld        (ComponentInstance         ci,
  899.                                  CodecDecompressParams * params,
  900.                                  GWorldPtr *            newGW,
  901.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0021, 0x7000, 0xA82A);
  902.  
  903. EXTERN_API( ComponentResult )
  904. ImageCodecDisposeImageGWorld    (ComponentInstance         ci,
  905.                                  GWorldPtr                 theGW)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0022, 0x7000, 0xA82A);
  906.  
  907. EXTERN_API( ComponentResult )
  908. ImageCodecHitTestDataWithFlags    (ComponentInstance         ci,
  909.                                  ImageDescriptionHandle  desc,
  910.                                  void *                    data,
  911.                                  Size                     dataSize,
  912.                                  Point                     where,
  913.                                  long *                    hit,
  914.                                  long                     hitFlags)                            FIVEWORDINLINE(0x2F3C, 0x0018, 0x0023, 0x7000, 0xA82A);
  915.  
  916. EXTERN_API( ComponentResult )
  917. ImageCodecValidateParameters    (ComponentInstance         ci,
  918.                                  QTAtomContainer         parameters,
  919.                                  QTParameterValidationOptions  validationFlags,
  920.                                  StringPtr                 errorString)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0024, 0x7000, 0xA82A);
  921.  
  922. EXTERN_API( ComponentResult )
  923. ImageCodecGetBaseMPWorkFunction    (ComponentInstance         ci,
  924.                                  ComponentMPWorkFunctionUPP * workFunction,
  925.                                  void **                refCon,
  926.                                  ImageCodecMPDrawBandUPP  drawProc,
  927.                                  void *                    drawProcRefCon)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x0025, 0x7000, 0xA82A);
  928.  
  929. EXTERN_API( ComponentResult )
  930. ImageCodecPreflight                (ComponentInstance         ci,
  931.                                  CodecDecompressParams * params)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  932.  
  933. EXTERN_API( ComponentResult )
  934. ImageCodecInitialize            (ComponentInstance         ci,
  935.                                  ImageSubCodecDecompressCapabilities * cap)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0201, 0x7000, 0xA82A);
  936.  
  937. EXTERN_API( ComponentResult )
  938. ImageCodecBeginBand                (ComponentInstance         ci,
  939.                                  CodecDecompressParams * params,
  940.                                  ImageSubCodecDecompressRecord * drp,
  941.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0202, 0x7000, 0xA82A);
  942.  
  943. EXTERN_API( ComponentResult )
  944. ImageCodecDrawBand                (ComponentInstance         ci,
  945.                                  ImageSubCodecDecompressRecord * drp)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0203, 0x7000, 0xA82A);
  946.  
  947. EXTERN_API( ComponentResult )
  948. ImageCodecEndBand                (ComponentInstance         ci,
  949.                                  ImageSubCodecDecompressRecord * drp,
  950.                                  OSErr                     result,
  951.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000A, 0x0204, 0x7000, 0xA82A);
  952.  
  953. EXTERN_API( ComponentResult )
  954. ImageCodecQueueStarting            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0205, 0x7000, 0xA82A);
  955.  
  956. EXTERN_API( ComponentResult )
  957. ImageCodecQueueStopping            (ComponentInstance         ci)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0206, 0x7000, 0xA82A);
  958.  
  959. EXTERN_API( ComponentResult )
  960. ImageCodecDroppingFrame            (ComponentInstance         ci,
  961.                                  const ImageSubCodecDecompressRecord * drp)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0207, 0x7000, 0xA82A);
  962.  
  963.  
  964.  
  965.  
  966. /* selectors for component calls */
  967. enum {
  968.     kImageCodecGetCodecInfoSelect                    = 0x0000,
  969.     kImageCodecGetCompressionTimeSelect                = 0x0001,
  970.     kImageCodecGetMaxCompressionSizeSelect            = 0x0002,
  971.     kImageCodecPreCompressSelect                    = 0x0003,
  972.     kImageCodecBandCompressSelect                    = 0x0004,
  973.     kImageCodecPreDecompressSelect                    = 0x0005,
  974.     kImageCodecBandDecompressSelect                    = 0x0006,
  975.     kImageCodecBusySelect                            = 0x0007,
  976.     kImageCodecGetCompressedImageSizeSelect            = 0x0008,
  977.     kImageCodecGetSimilaritySelect                    = 0x0009,
  978.     kImageCodecTrimImageSelect                        = 0x000A,
  979.     kImageCodecRequestSettingsSelect                = 0x000B,
  980.     kImageCodecGetSettingsSelect                    = 0x000C,
  981.     kImageCodecSetSettingsSelect                    = 0x000D,
  982.     kImageCodecFlushSelect                            = 0x000E,
  983.     kImageCodecSetTimeCodeSelect                    = 0x000F,
  984.     kImageCodecIsImageDescriptionEquivalentSelect    = 0x0010,
  985.     kImageCodecNewMemorySelect                        = 0x0011,
  986.     kImageCodecDisposeMemorySelect                    = 0x0012,
  987.     kImageCodecHitTestDataSelect                    = 0x0013,
  988.     kImageCodecNewImageBufferMemorySelect            = 0x0014,
  989.     kImageCodecExtractAndCombineFieldsSelect        = 0x0015,
  990.     kImageCodecGetMaxCompressionSizeWithSourcesSelect = 0x0016,
  991.     kImageCodecSetTimeBaseSelect                    = 0x0017,
  992.     kImageCodecSourceChangedSelect                    = 0x0018,
  993.     kImageCodecFlushFrameSelect                        = 0x0019,
  994.     kImageCodecGetSettingsAsTextSelect                = 0x001A,
  995.     kImageCodecGetParameterListHandleSelect            = 0x001B,
  996.     kImageCodecGetParameterListSelect                = 0x001C,
  997.     kImageCodecCreateStandardParameterDialogSelect = 0x001D,
  998.     kImageCodecIsStandardParameterDialogEventSelect = 0x001E,
  999.     kImageCodecDismissStandardParameterDialogSelect = 0x001F,
  1000.     kImageCodecStandardParameterDialogDoActionSelect = 0x0020,
  1001.     kImageCodecNewImageGWorldSelect                    = 0x0021,
  1002.     kImageCodecDisposeImageGWorldSelect                = 0x0022,
  1003.     kImageCodecHitTestDataWithFlagsSelect            = 0x0023,
  1004.     kImageCodecValidateParametersSelect                = 0x0024,
  1005.     kImageCodecGetBaseMPWorkFunctionSelect            = 0x0025,
  1006.     kImageCodecPreflightSelect                        = 0x0200,
  1007.     kImageCodecInitializeSelect                        = 0x0201,
  1008.     kImageCodecBeginBandSelect                        = 0x0202,
  1009.     kImageCodecDrawBandSelect                        = 0x0203,
  1010.     kImageCodecEndBandSelect                        = 0x0204,
  1011.     kImageCodecQueueStartingSelect                    = 0x0205,
  1012.     kImageCodecQueueStoppingSelect                    = 0x0206,
  1013.     kImageCodecDroppingFrameSelect                    = 0x0207
  1014. };
  1015.  
  1016.  
  1017.  
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025. enum {
  1026.     kMotionJPEGTag                = FOUR_CHAR_CODE('mjpg'),
  1027.     kJPEGQuantizationTablesImageDescriptionExtension = FOUR_CHAR_CODE('mjqt'),
  1028.     kJPEGHuffmanTablesImageDescriptionExtension = FOUR_CHAR_CODE('mjht'),
  1029.     kFieldInfoImageDescriptionExtension = FOUR_CHAR_CODE('fiel')
  1030. };
  1031.  
  1032.  
  1033. struct MotionJPEGApp1Marker {
  1034.     long                             unused;
  1035.     long                             tag;
  1036.     long                             fieldSize;
  1037.     long                             paddedFieldSize;
  1038.     long                             offsetToNextField;
  1039.     long                             qTableOffset;
  1040.     long                             huffmanTableOffset;
  1041.     long                             sofOffset;
  1042.     long                             sosOffset;
  1043.     long                             soiOffset;
  1044. };
  1045. typedef struct MotionJPEGApp1Marker        MotionJPEGApp1Marker;
  1046.  
  1047. EXTERN_API( ComponentResult )
  1048. QTPhotoSetSampling                (ComponentInstance         codec,
  1049.                                  short                     yH,
  1050.                                  short                     yV,
  1051.                                  short                     cbH,
  1052.                                  short                     cbV,
  1053.                                  short                     crH,
  1054.                                  short                     crV)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  1055.  
  1056. EXTERN_API( ComponentResult )
  1057. QTPhotoSetRestartInterval        (ComponentInstance         codec,
  1058.                                  unsigned short         restartInterval)                    FIVEWORDINLINE(0x2F3C, 0x0002, 0x0101, 0x7000, 0xA82A);
  1059.  
  1060. EXTERN_API( ComponentResult )
  1061. QTPhotoDefineHuffmanTable        (ComponentInstance         codec,
  1062.                                  short                     componentNumber,
  1063.                                  Boolean                 isDC,
  1064.                                  unsigned char *        lengthCounts,
  1065.                                  unsigned char *        values)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0102, 0x7000, 0xA82A);
  1066.  
  1067. EXTERN_API( ComponentResult )
  1068. QTPhotoDefineQuantizationTable    (ComponentInstance         codec,
  1069.                                  short                     componentNumber,
  1070.                                  unsigned char *        table)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0103, 0x7000, 0xA82A);
  1071.  
  1072.  
  1073. /* selectors for component calls */
  1074. enum {
  1075.     kQTPhotoSetSamplingSelect                        = 0x0100,
  1076.     kQTPhotoSetRestartIntervalSelect                = 0x0101,
  1077.     kQTPhotoDefineHuffmanTableSelect                = 0x0102,
  1078.     kQTPhotoDefineQuantizationTableSelect            = 0x0103
  1079. };
  1080.  
  1081.  
  1082.  
  1083.  
  1084. /* source identifier -- placed in root container of description, one or more required */
  1085.  
  1086. enum {
  1087.     kEffectSourceName            = FOUR_CHAR_CODE('src ')
  1088. };
  1089.  
  1090.  
  1091. /* source type -- placed in the input map to identify the source kind */
  1092.  
  1093. enum {
  1094.     kEffectDataSourceType        = FOUR_CHAR_CODE('dtst')
  1095. };
  1096.  
  1097. /*  default effect types */
  1098.  
  1099. enum {
  1100.     kEffectRawSource            = 0,                            /* the source is raw image data*/
  1101.     kEffectGenericType            = FOUR_CHAR_CODE('geff')        /* generic effect for combining others*/
  1102. };
  1103.  
  1104. typedef struct EffectSource             EffectSource;
  1105.  
  1106. typedef EffectSource *                    EffectSourcePtr;
  1107.  
  1108. union SourceData {
  1109.     CDSequenceDataSourcePtr         image;
  1110.     EffectSourcePtr                 effect;
  1111. };
  1112. typedef union SourceData                SourceData;
  1113.  
  1114. struct EffectSource {
  1115.     long                             effectType;                    /* type of effect or kEffectRawSource if raw ICM data*/
  1116.     Ptr                             data;                        /* track data for this effect*/
  1117.     SourceData                         source;                        /* source/effect pointers*/
  1118.     EffectSourcePtr                 next;                        /* the next source for the parent effect*/
  1119. };
  1120.  
  1121.  
  1122. struct EffectsFrameParams {
  1123.     ICMFrameTimeRecord                 frameTime;                    /* timing data*/
  1124.     long                             effectDuration;                /* the duration of a single effect frame*/
  1125.     Boolean                         doAsync;                    /* set to true if the effect can go async*/
  1126.     unsigned char                     pad[3];
  1127.     EffectSourcePtr                 source;                        /* ptr to the source input tree*/
  1128.     void *                            refCon;                        /* storage for the effect*/
  1129. };
  1130. typedef struct EffectsFrameParams        EffectsFrameParams;
  1131. typedef EffectsFrameParams *            EffectsFrameParamsPtr;
  1132.  
  1133.  
  1134. EXTERN_API( ComponentResult )
  1135. ImageCodecEffectSetup            (ComponentInstance         effect,
  1136.                                  CodecDecompressParams * p)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0300, 0x7000, 0xA82A);
  1137.  
  1138. EXTERN_API( ComponentResult )
  1139. ImageCodecEffectBegin            (ComponentInstance         effect,
  1140.                                  CodecDecompressParams * p,
  1141.                                  EffectsFrameParamsPtr     ePtr)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0301, 0x7000, 0xA82A);
  1142.  
  1143. EXTERN_API( ComponentResult )
  1144. ImageCodecEffectRenderFrame        (ComponentInstance         effect,
  1145.                                  EffectsFrameParamsPtr     p)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0302, 0x7000, 0xA82A);
  1146.  
  1147. EXTERN_API( ComponentResult )
  1148. ImageCodecEffectConvertEffectSourceToFormat (ComponentInstance  effect,
  1149.                                  EffectSourcePtr         sourceToConvert,
  1150.                                  ImageDescriptionHandle  requestedDesc)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0303, 0x7000, 0xA82A);
  1151.  
  1152. EXTERN_API( ComponentResult )
  1153. ImageCodecEffectCancel            (ComponentInstance         effect,
  1154.                                  EffectsFrameParamsPtr     p)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0304, 0x7000, 0xA82A);
  1155.  
  1156. EXTERN_API( ComponentResult )
  1157. ImageCodecEffectGetSpeed        (ComponentInstance         effect,
  1158.                                  QTAtomContainer         parameters,
  1159.                                  Fixed *                pFPS)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0305, 0x7000, 0xA82A);
  1160.  
  1161.  
  1162.  
  1163. /* selectors for component calls */
  1164. enum {
  1165.     kImageCodecEffectSetupSelect                    = 0x0300,
  1166.     kImageCodecEffectBeginSelect                    = 0x0301,
  1167.     kImageCodecEffectRenderFrameSelect                = 0x0302,
  1168.     kImageCodecEffectConvertEffectSourceToFormatSelect = 0x0303,
  1169.     kImageCodecEffectCancelSelect                    = 0x0304,
  1170.     kImageCodecEffectGetSpeedSelect                    = 0x0305
  1171. };
  1172.  
  1173.  
  1174. /* curve atom types and data structures */
  1175.  
  1176. enum {
  1177.     kCurvePathAtom                = FOUR_CHAR_CODE('path'),
  1178.     kCurveEndAtom                = FOUR_CHAR_CODE('zero'),
  1179.     kCurveAntialiasControlAtom    = FOUR_CHAR_CODE('anti'),
  1180.     kCurveAntialiasOff            = 0,
  1181.     kCurveAntialiasOn            = (long)0xFFFFFFFF,
  1182.     kCurveFillTypeAtom            = FOUR_CHAR_CODE('fill'),
  1183.     kCurvePenThicknessAtom        = FOUR_CHAR_CODE('pent'),
  1184.     kCurveMiterLimitAtom        = FOUR_CHAR_CODE('mitr'),
  1185.     kCurveJoinAttributesAtom    = FOUR_CHAR_CODE('join'),
  1186.     kCurveMinimumDepthAtom        = FOUR_CHAR_CODE('mind'),
  1187.     kCurveDepthAlwaysOffscreenMask = (long)0x80000000,
  1188.     kCurveTransferModeAtom        = FOUR_CHAR_CODE('xfer'),
  1189.     kCurveGradientAngleAtom        = FOUR_CHAR_CODE('angl'),
  1190.     kCurveGradientRadiusAtom    = FOUR_CHAR_CODE('radi'),
  1191.     kCurveGradientOffsetAtom    = FOUR_CHAR_CODE('cent')
  1192. };
  1193.  
  1194.  
  1195. enum {
  1196.     kCurveARGBColorAtom            = FOUR_CHAR_CODE('argb')
  1197. };
  1198.  
  1199.  
  1200. struct ARGBColor {
  1201.     unsigned short                     alpha;
  1202.     unsigned short                     red;
  1203.     unsigned short                     green;
  1204.     unsigned short                     blue;
  1205. };
  1206. typedef struct ARGBColor                ARGBColor;
  1207.  
  1208. enum {
  1209.     kCurveGradientRecordAtom    = FOUR_CHAR_CODE('grad')
  1210. };
  1211.  
  1212.  
  1213. struct GradientColorRecord {
  1214.     ARGBColor                         thisColor;
  1215.     Fixed                             endingPercentage;
  1216. };
  1217. typedef struct GradientColorRecord        GradientColorRecord;
  1218.  
  1219. typedef GradientColorRecord *            GradientColorPtr;
  1220.  
  1221. enum {
  1222.     kCurveGradientTypeAtom        = FOUR_CHAR_CODE('grdt')
  1223. };
  1224.  
  1225. /* currently supported gradient types */
  1226.  
  1227. enum {
  1228.     kLinearGradient                = 0,
  1229.     kCircularGradient            = 1
  1230. };
  1231.  
  1232. typedef long                             GradientType;
  1233. EXTERN_API( ComponentResult )
  1234. CurveGetLength                    (ComponentInstance         effect,
  1235.                                  gxPaths *                target,
  1236.                                  long                     index,
  1237.                                  wide *                    wideLength)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  1238.  
  1239. EXTERN_API( ComponentResult )
  1240. CurveLengthToPoint                (ComponentInstance         effect,
  1241.                                  gxPaths *                target,
  1242.                                  long                     index,
  1243.                                  Fixed                     length,
  1244.                                  FixedPoint *            location,
  1245.                                  FixedPoint *            tangent)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0101, 0x7000, 0xA82A);
  1246.  
  1247. EXTERN_API( ComponentResult )
  1248. CurveNewPath                    (ComponentInstance         effect,
  1249.                                  Handle *                pPath)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);
  1250.  
  1251. EXTERN_API( ComponentResult )
  1252. CurveCountPointsInPath            (ComponentInstance         effect,
  1253.                                  gxPaths *                aPath,
  1254.                                  unsigned long             contourIndex,
  1255.                                  unsigned long *        pCount)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0103, 0x7000, 0xA82A);
  1256.  
  1257. EXTERN_API( ComponentResult )
  1258. CurveGetPathPoint                (ComponentInstance         effect,
  1259.                                  gxPaths *                aPath,
  1260.                                  unsigned long             contourIndex,
  1261.                                  unsigned long             pointIndex,
  1262.                                  gxPoint *                thePoint,
  1263.                                  Boolean *                ptIsOnPath)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0104, 0x7000, 0xA82A);
  1264.  
  1265. EXTERN_API( ComponentResult )
  1266. CurveInsertPointIntoPath        (ComponentInstance         effect,
  1267.                                  gxPoint *                aPoint,
  1268.                                  Handle                 thePath,
  1269.                                  unsigned long             contourIndex,
  1270.                                  unsigned long             pointIndex,
  1271.                                  Boolean                 ptIsOnPath)                            FIVEWORDINLINE(0x2F3C, 0x0012, 0x0105, 0x7000, 0xA82A);
  1272.  
  1273. EXTERN_API( ComponentResult )
  1274. CurveSetPathPoint                (ComponentInstance         effect,
  1275.                                  gxPaths *                aPath,
  1276.                                  unsigned long             contourIndex,
  1277.                                  unsigned long             pointIndex,
  1278.                                  gxPoint *                thePoint,
  1279.                                  Boolean                 ptIsOnPath)                            FIVEWORDINLINE(0x2F3C, 0x0012, 0x0106, 0x7000, 0xA82A);
  1280.  
  1281. EXTERN_API( ComponentResult )
  1282. CurveGetNearestPathPoint        (ComponentInstance         effect,
  1283.                                  gxPaths *                aPath,
  1284.                                  FixedPoint *            thePoint,
  1285.                                  unsigned long *        contourIndex,
  1286.                                  unsigned long *        pointIndex,
  1287.                                  Fixed *                theDelta)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0107, 0x7000, 0xA82A);
  1288.  
  1289. EXTERN_API( ComponentResult )
  1290. CurvePathPointToLength            (ComponentInstance         ci,
  1291.                                  gxPaths *                aPath,
  1292.                                  Fixed                     startDist,
  1293.                                  Fixed                     endDist,
  1294.                                  FixedPoint *            thePoint,
  1295.                                  Fixed *                pLength)                            FIVEWORDINLINE(0x2F3C, 0x0014, 0x0108, 0x7000, 0xA82A);
  1296.  
  1297. EXTERN_API( ComponentResult )
  1298. CurveCreateVectorStream            (ComponentInstance         effect,
  1299.                                  Handle *                pStream)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0109, 0x7000, 0xA82A);
  1300.  
  1301. EXTERN_API( ComponentResult )
  1302. CurveAddAtomToVectorStream        (ComponentInstance         effect,
  1303.                                  OSType                 atomType,
  1304.                                  Size                     atomSize,
  1305.                                  void *                    pAtomData,
  1306.                                  Handle                 vectorStream)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x010A, 0x7000, 0xA82A);
  1307.  
  1308. EXTERN_API( ComponentResult )
  1309. CurveAddPathAtomToVectorStream    (ComponentInstance         effect,
  1310.                                  Handle                 pathData,
  1311.                                  Handle                 vectorStream)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x010B, 0x7000, 0xA82A);
  1312.  
  1313. EXTERN_API( ComponentResult )
  1314. CurveAddZeroAtomToVectorStream    (ComponentInstance         effect,
  1315.                                  Handle                 vectorStream)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x010C, 0x7000, 0xA82A);
  1316.  
  1317. EXTERN_API( ComponentResult )
  1318. CurveGetAtomDataFromVectorStream (ComponentInstance     effect,
  1319.                                  Handle                 vectorStream,
  1320.                                  long                     atomType,
  1321.                                  long *                    dataSize,
  1322.                                  Ptr *                    dataPtr)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x010D, 0x7000, 0xA82A);
  1323.  
  1324.  
  1325.  
  1326. /* selectors for component calls */
  1327. enum {
  1328.     kCurveGetLengthSelect                            = 0x0100,
  1329.     kCurveLengthToPointSelect                        = 0x0101,
  1330.     kCurveNewPathSelect                                = 0x0102,
  1331.     kCurveCountPointsInPathSelect                    = 0x0103,
  1332.     kCurveGetPathPointSelect                        = 0x0104,
  1333.     kCurveInsertPointIntoPathSelect                    = 0x0105,
  1334.     kCurveSetPathPointSelect                        = 0x0106,
  1335.     kCurveGetNearestPathPointSelect                    = 0x0107,
  1336.     kCurvePathPointToLengthSelect                    = 0x0108,
  1337.     kCurveCreateVectorStreamSelect                    = 0x0109,
  1338.     kCurveAddAtomToVectorStreamSelect                = 0x010A,
  1339.     kCurveAddPathAtomToVectorStreamSelect            = 0x010B,
  1340.     kCurveAddZeroAtomToVectorStreamSelect            = 0x010C,
  1341.     kCurveGetAtomDataFromVectorStreamSelect            = 0x010D
  1342. };
  1343. /* UPP call backs */
  1344.  
  1345. #if PRAGMA_STRUCT_ALIGN
  1346.     #pragma options align=reset
  1347. #elif PRAGMA_STRUCT_PACKPUSH
  1348.     #pragma pack(pop)
  1349. #elif PRAGMA_STRUCT_PACK
  1350.     #pragma pack()
  1351. #endif
  1352.  
  1353. #ifdef PRAGMA_IMPORT_OFF
  1354. #pragma import off
  1355. #elif PRAGMA_IMPORT
  1356. #pragma import reset
  1357. #endif
  1358.  
  1359. #ifdef __cplusplus
  1360. }
  1361. #endif
  1362.  
  1363. #endif /* __IMAGECODEC__ */
  1364.  
  1365.